<?php

class Request
{

    protected $method;
    protected $postParams;
    protected $getParams;
    
    public function __construct()
    {
        $route = new Route();
        $this->getParams = $route->getParams();
        $this->postParams = $_POST;
        $this->method = $_SERVER["REQUEST_METHOD"];
     }
    
    public function isPOST()
    {
        return ($this->method == "POST");
    }
    
    public function isGET()
    {
        return ($this->method == "GET");
    }
    
    public function POST($key)
    {
        return (isset($this->postParams[$key]))?$this->postParams[$key]:"";
    }
    
    public function GET($key)
    {
        return (isset($this->getParams[$key]))?$this->postParams[$key]:"";
    }
}
